package wbbs.web.admin;

import cn.webwheel.Action;
import cn.webwheel.results.TemplateResult;
import wbbs.domain.User;
import wbbs.service.PaginatedList;

import java.sql.SQLException;
import java.util.List;

public class users extends BaseAction {

    public int p;

    public int ps;

    PaginatedList<User> users;

    @Action
    public Object html() throws SQLException {

        ensureLoginPage();

        if (ps < 1 || ps > 200) ps = 30;
        ensureLoginPage();
        users = userService.listUser(p, ps);
        return new TemplateResult(this);
    }

    public List<User> getUsers() {
        return users;
    }
}
